using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text.Json;

namespace IdPhotoAPIClient
{
    class Program
    {
        private static string _timeString = DateTime.Now.ToString("yyMMdd_HHmmssfff");

        static async Task Main(string[] args)
        {
            Console.WriteLine("证件照API客户端示例程序");

            // DEOM
            //await IdPhotoDemo.Test();

            // 创建API客户端实例
            var client = new IdPhotoApiClient("http://localhost:8080");
            string imagePath = "test.jpg"; //图片相对地址
            var helper = new IdPhotoHelper(client, imagePath);

            // 示例：生成证件照(底透明)
            var fileName1 = await helper.CreateIdPhoto();

            // 示例：添加背景色
            //imagePath = _timeString + "_standard.jpg"; // 使用之前生成的透明底图片
            var fileName2 = await helper.CreateIdPhotoWatermark();

            Console.WriteLine("按任意键退出...");
            Console.ReadKey();
        }
    }
}